/**
 * @Author 12629
 * @Date 2022/5/8 9:48
 * @Description：
 */
public class Date {

    private int year;
    private int month;
    private int day;

    public Date() {
        /*this.year = 1992;
        this.month = 9;
        this.day = 19;*/
        //调用另一个带有3个参数的构造方法
        //this(1850,2,3);
        System.out.println("不带参数的构造方法！");
    }

    public Date(int year,int month,int day) {
        //this();
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("调用带有3个参数的构造方法！");
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public void setDate(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
        //this.printDate();
    }

    public void printDate() {
        System.out.println(this.year+" "+this.month+" " + this.day);
    }

    /*public static void main3(String[] args) {
        Date date1 = new Date();
        date1.printDate();

    }

    public static void main2(String[] args) {
        Date date1 = new Date();
        System.out.println("===========");
        Date date2 = new Date(1998,9,6);
        date2.printDate();
    }



    public static void main1(String[] args) {
        Date date1 = new Date();
        date1.setDate(2020,5,8);
        date1.printDate();

        Date date2 = new Date();
        date2.setDate(2021,5,8);
        date2.printDate();

        Date date3 = new Date();
        date3.setDate(2022,5,8);
        date3.printDate();

    }*/
}
